/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.feiyue.helper;

import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.Random;

public class Helper {
	public static int getRandomCover_big(int paramInt) {
		if (paramInt == 1)
			return 2130837508;
		if (paramInt == 2)
			return 2130837509;
		if (paramInt == 3)
			return 2130837510;
		if (paramInt == 4)
			return 2130837511;
		if (paramInt == 5)
			return 2130837512;
		if (paramInt == 6)
			return 2130837513;
		if (paramInt == 7)
			return 2130837514;
		if (paramInt == 8)
			return 2130837515;
		return 0;
	}

	public static int getRandomCover_index() {
		return (1 + new Random().nextInt(8));
	}

	public static int getRandomCover_small(int paramInt) {
		if (paramInt == 1)
			return 2130837681;
		if (paramInt == 2)
			return 2130837682;
		if (paramInt == 3)
			return 2130837683;
		if (paramInt == 4)
			return 2130837684;
		if (paramInt == 5)
			return 2130837685;
		if (paramInt == 6)
			return 2130837686;
		if (paramInt == 7)
			return 2130837688;
		if (paramInt == 8)
			return 2130837689;
		return 0;
	}

	public static void parseConfig(String[] paramArrayOfString1,
			String[] paramArrayOfString2, String[] paramArrayOfString3) {
		int i = 0;
		int j = paramArrayOfString1.length;
		if (j == 0)
			return;
		while (true) {
			if (i < j)
				;
			String str1 = paramArrayOfString1[i].split(",")[0];
			String str2 = paramArrayOfString1[i].split(",")[1];
			int k = str1.length();
			int l = str2.length();
			paramArrayOfString2[i] = str1.substring(1, k - 1);
			paramArrayOfString3[i] = str2.substring(1, l - 1);
			++i;
		}
	}

	public static String readConfig(Context paramContext, String paramString) {
		InputStream localInputStream = null;
		BufferedReader localBufferedReader = null;
		String result = "";
		try {
			localInputStream = paramContext.getResources()
					.getAssets().open(paramString);
			localBufferedReader = new BufferedReader(
					new InputStreamReader(localInputStream, "utf-8"));
			String str1 = localBufferedReader.readLine();
			if (str1 != null) {
				result = str1;
			}
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				localBufferedReader.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
			try {
				localInputStream.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return result;
	}
}